<?php
if (isset($breadcrumb) && !empty($breadcrumb)) :
	echo $this->element('breadcrumb');
endif;
if(isset($detail_news) && !empty($detail_news)):?>
<div class="pad group">
	<div class="post-list group">
		<div class="lbl-category pad">
			<p><?php echo $detail_news['News']['name'];?></p>
		</div>
		<div class="group-content">
			<div class="detail-content clearfix">
				<p><strong><?php echo $detail_news['News']['brief'];?></strong></p>
				<div class="entry-inner"><?php echo $detail_news['News']['contents'];?></div>
				<div class="sharrre-container">
					<span>Chia sẻ</span>
					<div data-title="Tweet" data-text="<?php echo $detail_news['News']['name'];?>" data-url="<?php echo Router::url( $this->here, true ); ?> " id="twitter" class="sharrre">
					</div>
					<div data-title="Like" data-text="<?php echo $detail_news['News']['name'];?>" data-url="<?php echo Router::url( $this->here, true ); ?> " id="facebook" class="sharrre">
					</div>
					<div data-title="+1" data-text="<?php echo $detail_news['News']['name'];?>" data-url="<?php echo Router::url( $this->here, true ); ?> " id="googleplus" class="sharrre">
					</div>
					<div data-title="Pin It" data-text="<?php echo $detail_news['News']['name'];?>" data-url="<?php echo Router::url( $this->here, true ); ?> " id="pinterest" class="sharrre"></div>
				</div><!--/.sharrre-container-->

				<script type="text/javascript">
					// Sharrre
					jQuery(document).ready(function(){
						jQuery('#twitter').sharrre({
							share: {
								twitter: true
							},
							template: '<a class="box" href="#"><div class="count" href="#">{total}</div><div class="share"><i class="fa fa-twitter"></i></div></a>',
							enableHover: false,
							enableTracking: true,
							buttons: { twitter: {via: ''}},
							click: function(api, options){
								api.simulateClick();
								api.openPopup('twitter');
							}
						});
						jQuery('#facebook').sharrre({
							share: {
								facebook: true
							},
							template: '<a class="box" href="#"><div class="count" href="#">{total}</div><div class="share"><i class="fa fa-facebook-square"></i></div></a>',
							enableHover: false,
							enableTracking: true,
							click: function(api, options){
								api.simulateClick();
								api.openPopup('facebook');
							}
						});
						jQuery('#googleplus').sharrre({
							share: {
								googlePlus: true
							},
							template: '<a class="box" href="#"><div class="count" href="#">{total}</div><div class="share"><i class="fa fa-google-plus-square"></i></div></a>',
							enableHover: false,
							enableTracking: true,
							urlCurl: '/js/sharrre.php',
							click: function(api, options){
								api.simulateClick();
								api.openPopup('googlePlus');
							}
						});
						jQuery('#pinterest').sharrre({
							share: {
								pinterest: true
							},
							template: '<a class="box" href="#" rel="nofollow"><div class="count" href="#">{total}</div><div class="share"><i class="fa fa-pinterest"></i></div></a>',
							enableHover: false,
							enableTracking: true,
							buttons: {
							pinterest: {
								description: 'Being Outside in Fresh Air &#038; How Your Body Loves It',media: 'http://demo.alxmedia.se/hueman/wp-content/uploads/sites/2/2013/10/shoes-181744_1280.jpg'				}
							},
							click: function(api, options){
								api.simulateClick();
								api.openPopup('pinterest');
							}
						});


					});

				</script>
				<div class="clear"></div>
			</div>
			<?php
			if(isset($detail_news['other_news']) && !empty($detail_news['other_news'])):
			?>
			<h4 class="heading">Các tin khác cùng danh mục</h4>
				<ul class="other-news">
					<?php
					foreach ($detail_news['other_news'] as $others):
					$linkDetail = $this->Html->url(
							array(
									'controller' => 'news',
									'action' => 'detail',
									'news_id' => $others['news']['id'],
									'news_rewrite' => $others['news']['new_rewrite'],
									'cat_rewrite' => $detail_news['Category']['cat_rewrite'],
									'ext' => 'html',
							)
					);
					?>
					<li><i class="fa fa-angle-right"></i><a href="<?php echo $linkDetail;?>"><?php echo $others['news']['name']?></a></li>
					<?php
					endforeach;
					?>
				</ul>
			<?php endif;?>
		</div>
	</div>
</div>
<?php
endif;
?>
<div class="clear"></div>